import { createRequest } from '/@/api/service';
const module = 'ib/equipment/v1/AssetManageApi/';

/**
 * 资产列表查询——默认不查库存中的资产
 * @param data
 * @param header
 * @returns
 */
function QUERY_ASSET_LIST(
  data: AssetManageApi.QueryAssetListReq,
  header: object = {},
): Promise<AssetManageApi.QueryAssetListResp> {
  return createRequest(`${process.env.APP_API_URL}${module}queryAssetList`, data, header, 'POST');
}

/**
 * 资产详情查询
 * @param data 请求数据
 * @param header
 * @returns
 */
function ASSET_DETAIL_QUERY(
  data: AssetManageApi.AssetDetailQueryReq,
  header: object = {},
): Promise<AssetManageApi.AssetDetailQueryResp> {
  return createRequest(`${process.env.APP_API_URL}${module}queryAssetDetail`, data, header, 'POST');
}

/**
 * @description 资产App端扫码后调用的接口
 * @param data 请求数据
 * @param header header请求数据
 * @returns 返回实体
 */
function ASSET_BY_APP_DETAIL_QUERY(
  data: AssetManageApi.AssetByAppDetailQueryReq,
  header: object = {},
): Promise<AssetManageApi.AssetByAppDetailQueryResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}queryAssetByAppDetail`,
    data,
    header,
    'POST',
  );
}

export { QUERY_ASSET_LIST, ASSET_DETAIL_QUERY, ASSET_BY_APP_DETAIL_QUERY };
